package com.after.saas.file.function;

import com.after.saas.client.service.RemoteDictService;
import com.after.saas.common.model.bo.CoreDictBO;
import com.after.saas.file.utils.SpringUtil;
import com.alibaba.fastjson.JSON;

import lombok.extern.slf4j.Slf4j;

import java.util.List;


/**
 * @Classname CommentConsumer
 * @Description TODO
 * @Date 2021/3/25 9:04
 * @Created by hjchen
 */

@Slf4j
public class DictConsumer implements ExcelConsumer<CoreDictBO> {

    private final RemoteDictService remoteDictService = SpringUtil.getBean(RemoteDictService.class);

    @Override
    public void executeRead(List<CoreDictBO> e) {
        log.warn("remoteDictService {}", remoteDictService);
//        remoteDictService.batchSave(e);
        e.forEach(s -> {
            log.info("s {}", JSON.toJSON(s));
        });
    }

    @Override
    public void check(List<CoreDictBO> e) {
        log.warn("check {}", e.size());
    }
}